package com.donfu.system.service.house.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.donfu.system.domain.house.HouseCollection;
import com.donfu.system.domain.house.HouseCommentLike;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import com.donfu.system.mapper.house.HouseCommentMapper;
import com.donfu.system.domain.house.HouseComment;
import com.donfu.system.service.house.IHouseCommentService;

/**
 * 评论信息Service业务层处理
 *
 * @author donfu
 * @date 2021-12-01
 */
@Service
public class HouseCommentServiceImpl implements IHouseCommentService {
    @Autowired
    private HouseCommentMapper houseCommentMapper;

    /**
     * 查询评价信息详情
     *
     * @param id 评价信息主键
     * @return 评价信息
     */
    @Override
    public HouseComment selectHouseCommentById(Long id) {
        HouseComment houseComment = houseCommentMapper.selectHouseCommentById(id);
        return houseComment;
    }

    /**
     * 查询评论信息列表
     *
     * @param houseComment 评论信息
     * @return 评论信息
     */
    @Override
    public List<HouseComment> selectHouseCommentList(HouseComment houseComment) {
        List<HouseComment> houseComments = houseCommentMapper.selectHouseCommentList(houseComment);
     return houseComments;
    }

    /**
     * 查询评价信息列表
     *
     * @param houseComment 评论信息
     * @return 结果
     */
    @Override
    public List<HouseComment> selectHouseEvaluateList(HouseComment houseComment) {
        return houseCommentMapper.selectHouseEvaluateList(houseComment);
    }

    /**
     * 新增评论信息
     *
     * @param houseComment 评论信息
     * @return 结果
     */
    @Override
    public int insertHouseComment(HouseComment houseComment) {
        houseComment.setCreateDate(new Date());
        return houseCommentMapper.insertHouseComment(houseComment);
    }

    /**
     * 修改评论信息
     *
     * @param houseComment 评论信息
     * @return 结果
     */
    @Override
    public int updateHouseComment(HouseComment houseComment) {
        houseComment.setUpdateDate(new Date());
        return houseCommentMapper.updateHouseComment(houseComment);
    }

    /**
     * 批量删除评论信息
     *
     * @param ids 需要删除的评论信息主键
     * @return 结果
     */
    @Override
    public int deleteHouseCommentByIds(Long[] ids) {
        return houseCommentMapper.deleteHouseCommentByIds(ids);
    }

    /**
     * 删除评论信息信息
     *
     * @param id 评论信息主键
     * @return 结果
     */
    @Override
    public int deleteHouseCommentById(Long id) {
        return houseCommentMapper.deleteHouseCommentById(id);
    }
}
